#include "OutputParam.h"

OutputParam::OutputParam(JNIEnv* env)
{
	m_env = env;
	m_clsobj = (m_env)->FindClass("com/voe/common/OutputParam");
	jmethodID mid = (m_env)->GetMethodID(m_clsobj, "<init>", "()V");
	m_param = (m_env)->NewObject(m_clsobj, mid);
}

OutputParam::OutputParam(JNIEnv* env, jobject param)
{
	m_env = env;
	m_param = param;
	m_clsobj = (m_env)->FindClass("com/voe/common/OutputParam");
}

OutputParam::~OutputParam(void)
{

}

void OutputParam::setArray(jobjectArray array)
{
	jmethodID mid = (m_env)->GetMethodID(m_clsobj, "setObject", "([Ljava/lang/Object;)V");
	(m_env)->CallVoidMethod(m_param, mid, array);
}

jobjectArray OutputParam::getArray()
{
	jmethodID mid = (m_env)->GetMethodID(m_clsobj, "getObject", "(V)[Ljava/lang/Object;");
	return (jobjectArray)(m_env)->CallObjectMethod(m_param, mid);
}

jobject OutputParam::getOutput()
{
	return m_param;
}